import VueRouter from 'vue-router'


import home from './components/home.vue'
import car from './components/car.vue'
import search from './components/search.vue'
import vip from './components/vip.vue'
import newsInfo from './components/news/new.vue'
import newone from './components/news/newone.vue'
import images from './components/imglist/images.vue'
import imageInfo from './components/imglist/imageInfo.vue'
import shopping from './components/shop/shopping.vue'
import shoppingone from './components/shop/shoppingone.vue'
import shopcomment from './components/shop/shopcomment.vue'
import shopinfo from './components/shop/shopinfo.vue'

// 3. 创建路由对象
var router = new VueRouter({
  routes: [
    { path:'/', redirect: 'home'},
    { path:'/home',  component: home },
    { path: '/car', component: car },
    { path: '/search', component: search },
    { path: '/vip', component: vip },
    { path: '/newsInfo', component: newsInfo },
    { path: '/home/newone/:id', component: newone },
    { path: '/home/images', component: images },
    { path: '/home/images/imageInfo:id', component: imageInfo },
    { path: '/home/shopping', component: shopping },
    { path: '/shopping/shoppingone/:id', component: shoppingone,name:'shoppingone'},
    { path: '/shopping/shoppingcomment/:id', component: shopcomment, name: 'shopcomment' },
    { path: '/shopping/shoppinginfo/:id', component: shopinfo, name: 'shopinfo' }
  ],
  linkActiveClass:'mui-active'
})

// 把路由对象暴露出去
export default router